<?php
/* @var $this PageController */
/* @var $model Page */
/* @var $form CActiveForm */
?>

<script>

$(document).ready(function() {

	if($("#Page_code").val() != 'INTRO'){
		$('#Page_content').wymeditor({
			html : $("#Page_content").val()
		});
		
		$("form").submit(function(){
			$("#Page_content").val($.wymeditors(0).xhtml());
			return true;
		});
	}
	
});


</script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'page-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row" style="display: none;">
		<?php echo $form->labelEx($model,'code'); ?>
		<?php echo $form->textField($model,'code',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'code'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'content'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->